package com.ruoyi.finance.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 查询收费对象 charge_record
 *
 * @author zt
 * @date 2023-11-15
 */
public class ChargeRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    private Integer id;

    /**
     * 商户号
     */
    @Excel(name = "商户号")
    private String merchantCode;

    /**
     * 请求单号
     */
    @Excel(name = "商户侧订单号")
    private String requestSn;

    /**
     * 返回单号
     */
    @Excel(name = "商户侧订单号")
    private String responseSn;

    /**
     * 接口编号
     */
    @Excel(name = "接口编号")
    private String interName;

    /**
     * 接口调用关键字
     */
    @Excel(name = "接口调用关键字")
    private String interKeyword;

    /**
     * 查询结果
     */
    @Excel(name = "查询结果")
    private String queryResult;

    /**
     * 收费时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "收费时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
    private Date chargeTime = new Date();

    /**
     * 扣费额
     */
    @Excel(name = "扣费额")
    private BigDecimal costNum;

    /**
     * 收费结果
     */
    @Excel(name = "收费结果")
    private String costResult;

    /**
     * 剩余额度
     */
    @Excel(name = "剩余额度")
    private BigDecimal balance;

    public ChargeRecord() {
    }
    public ChargeRecord(Integer id, String queryResult) {
        this.id = id;
        this.queryResult = queryResult;
    }

    public ChargeRecord(Integer id, String interKeyword, String queryResult) {
        this.id = id;
        this.interKeyword = interKeyword;
        this.queryResult = queryResult;
    }

    public ChargeRecord(String merchantCode, String requestSn, String interName, String interKeyword, String queryResult, BigDecimal costNum) {
        this.merchantCode = merchantCode;
        this.requestSn = requestSn;
        this.interName = interName;
        this.interKeyword = interKeyword;
        this.queryResult = queryResult;
        this.costNum = costNum;
    }

    public ChargeRecord(String merchantCode, String requestSn, String responseSn, String interName, String interKeyword,
                        String queryResult, BigDecimal costNum) {
        this.merchantCode = merchantCode;
        this.requestSn = requestSn;
        this.responseSn = responseSn;
        this.interName = interName;
        this.interKeyword = interKeyword;
        this.queryResult = queryResult;
        this.costNum = costNum;
    }

    public ChargeRecord(String merchantCode, String requestSn, String interName, String interKeyword,
                        BigDecimal costNum, BigDecimal balance) {
        this.merchantCode = merchantCode;
        this.requestSn = requestSn;
        this.interName = interName;
        this.interKeyword = interKeyword;
        this.costNum = costNum;
        this.balance = balance;
        this.queryResult = "待获取";
        this.costResult = "收费成功";
    }

    public ChargeRecord(String merchantCode, String requestSn, String interName, String interKeyword,
                        String queryResult, BigDecimal costNum, BigDecimal balance, String costResult) {
        this.merchantCode = merchantCode;
        this.requestSn = requestSn;
        this.interName = interName;
        this.interKeyword = interKeyword;
        this.chargeTime = new Date();
        this.queryResult = queryResult;
        this.costNum = costNum;
        this.balance = balance;
        this.costResult = costResult;
    }


    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setMerchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
    }

    public String getMerchantCode() {
        return merchantCode;
    }

    public String getRequestSn() {
        return requestSn;
    }

    public void setRequestSn(String requestSn) {
        this.requestSn = requestSn;
    }

    public String getResponseSn() {
        return responseSn;
    }

    public void setResponseSn(String responseSn) {
        this.responseSn = responseSn;
    }

    public void setInterName(String interName) {
        this.interName = interName;
    }

    public String getInterName() {
        return interName;
    }

    public void setInterKeyword(String interKeyword) {
        this.interKeyword = interKeyword;
    }

    public String getInterKeyword() {
        return interKeyword;
    }

    public void setQueryResult(String queryResult) {
        this.queryResult = queryResult;
    }

    public String getQueryResult() {
        return queryResult;
    }

    public void setChargeTime(Date chargeTime) {
        this.chargeTime = chargeTime;
    }

    public Date getChargeTime() {
        return chargeTime;
    }

    public void setCostNum(BigDecimal costNum) {
        this.costNum = costNum;
    }

    public BigDecimal getCostNum() {
        return costNum;
    }

    public void setCostResult(String costResult) {
        this.costResult = costResult;
    }

    public String getCostResult() {
        return costResult;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public BigDecimal getBalance() {
        return balance;
    }


    @Override
    public String toString() {
        return "ChargeRecord{" +
                "id=" + id +
                ", merchantCode='" + merchantCode + '\'' +
                ", requestSn='" + requestSn + '\'' +
                ", responseSn='" + responseSn + '\'' +
                ", interName='" + interName + '\'' +
                ", interKeyword='" + interKeyword + '\'' +
                ", queryResult='" + queryResult + '\'' +
                ", chargeTime=" + chargeTime +
                ", costNum=" + costNum +
                ", costResult='" + costResult + '\'' +
                ", balance=" + balance +
                '}';
    }
}
